/* eslint-disable */
import React from 'react'
import ReactDom from 'react-dom'
import { Provider } from 'react-redux'
import store from './common/store'
import { BrowserRouter as Router } from 'react-router-dom'
import App from './common/App'
import './common/Layout.scss'
import './common/common.scss'
import { getUser } from './common/commonAction'

//登录者信息
let user = (store.getState().Common || {}).user
!user &&
  store.dispatch(getUser()).then(() => {
    hotReload()
    //组件热启
    module.hot && module.hot.accept('./common/App', () => hotReload(require('./common/App'))) /**/
  })

//渲染DOM
function hotReload() {
  ReactDom.render(
    <Provider store={store}>
      <Router>
        <App />
      </Router>
    </Provider>,
    document.getElementById('root')
  )
}
